<template>
	<view>
		<homeHead ref="homeHead" :cardList="cardList" @reloadServerInfo="reloadServerInfo"/>
		
		<!-- 新闻列表 -->
		<view @onPageScroll="scroll">
			<newList ref="newList" :class="top>30?'aa':'bb'"></newList>
		</view>
	</view>
</template>

<script>
	import homeHead from '../../../components/home-head/home-head.vue'
	import newList from  '../../../components/new-list/new-list.vue'
	export default {
		components:{
			homeHead,newList
		},
		data() {
			return {
				top:''
			};
		},
		props:['cardList'],
		onPageScroll(e){
		},
		methods:{
			scroll(top){  //菜单展开关闭
				this.top = top
				if(top>=25){
				  this.$refs.homeHead.pclose(true)
				}else if(top<25){
				  this.$refs.homeHead.pclose(false)
				}
			},
			getNewList(){
				 this.$refs.newList.getBallInfo()
				 this.$refs.newList.getListInfo()
			},
			getMoreNewList(){
				 this.$refs.newList.getMoreList()
			},
			reloadServerInfo(){
				this.$emit('reloadServerInfo','')
			},
			getFamily(){
				this.$refs.homeHead.getFamily()
			},
			initHasIsRead () {
				this.$refs.homeHead.initHasIsRead()
			}
			
		}
	}
</script>

<style lang="less" scoped>
	.aa{
		margin-top: 70rpx;
	}
</style>
